﻿<%@ Page Language="C#" MasterPageFile="~/Masters/AdminSchedule.master" AutoEventWireup="true" CodeFile="Schedule.aspx.cs" Inherits="Pages_Admin_Schedule" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" Runat="Server">
	<style type="text/css">
		.modaldiv
		{
			overflow: hidden;
			border: solid 2px black;
			padding: 5px;
		}
	</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphContent" Runat="Server">
	<p>
		<a href='<%= ResolveUrl("~/Pages/Admin/ScheduleEdit.aspx") %>'>Добавить новый шаблон</a>
	</p>
	<asp:Repeater runat="server" ID="rptSchedule">
		<HeaderTemplate>
			<table style="margin: 10px auto;">
				<tr>
					<th style="width: 200px;">Маршрут</th>
					<th style="width: 100px;">Автобус</th>
					<th style="width: 70px;">Время</th>
					<th style="width: 120px;">Начало</th>
					<th style="width: 120px;">Конец</th>
					<th style="width: 200px;">Дни следования</th>
					<th style="width: 70px;">Генерация</th>
				</tr>
		</HeaderTemplate>
		<ItemTemplate>
				<tr>
					<td>
						<a href='<%= ResolveUrl("~/Pages/Admin/ScheduleEdit.aspx?Id=") %><%# Eval("TripRule_id") %>'>
							<%# Eval("Route_name") %>
						</a>
					</td>
					<td><%# Eval("Bus_name") %></td>
					<td><%# DS.ToShortStringTime(Eval("TripRule_Time")) %></td>
					<td><%# DS.ToShortStringDateTime(Eval("TripRule_StartDT")) %></td>
					<td><%# DS.ToShortStringDateTime(Eval("TripRule_EndDT")) %></td>
					<td><%# Eval("scheduleDay")%></td>
					<td>
						<asp:LinkButton runat="server" ID="lbGenerate" CommandArgument='<%# Eval("TripRule_id") %>'
										OnClick="OnGenerate" Text="Сгенерировать" />
					</td>
				</tr>
		</ItemTemplate>
		<FooterTemplate>
			</table>
		</FooterTemplate>
	</asp:Repeater>
	<div id="modal" runat="server" class="modaldiv" style="display: none;">
		<asp:UpdatePanel runat="server" ID="upStation">
			<ContentTemplate>
				С <asp:TextBox runat="server" ID="tbStartDT" Width="250" />
				по <asp:TextBox runat="server" ID="tbEndDT" Width="250" />
				<asp:HiddenField runat="server" ID="hfModalAction" />
			</ContentTemplate>
		</asp:UpdatePanel>
		<div style="text-align: right;">
			<asp:Button runat="server" ID="btnModalClose" Text="Закрыть" />
		</div>
	</div>
	<asp:LinkButton Text="" runat="server" ID="lnkPopup" />
	<ajax:ModalPopupExtender ID="MPE" runat="server" PopupControlID="modal" TargetControlID="lnkPopup"
		CancelControlID="btnModalClose" BehaviorID="MPEbeh" BackgroundCssClass="ui-modal-overlay"
		OkControlID="btnModalClose" />
</asp:Content>

